package other;

import java.lang.reflect.Constructor;

/**
 * create by Sun
 * 2018/8/6
 */
public class testDemo {
    public static void main(String[] args) throws Exception {
        Class<SingleDemo> clazz= (Class<SingleDemo>) Class.forName("other.SingleDemo");
        Constructor<SingleDemo> declaredConstructor = clazz.getDeclaredConstructor(null);
        declaredConstructor.setAccessible(true);
        SingleDemo singleDemo = declaredConstructor.newInstance();
        System.out.println(singleDemo);
        SingleDemo singleDemo1 = declaredConstructor.newInstance();
        System.out.println(singleDemo1);
    }
}
